<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('线上交易数据')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="width: 80px;">商户编号：</label>
                            <input type="text" name="merNo"/>
                        </li>
                        <li>
                            <label>流水号：</label>
                            <input type="text" name="serial"/>
                        </li>
                        <li>
                            <label>交易状态：</label>
                            <select name="status">
                                <option value="">请选择</option>
                                <option value="-1">撤销</option>
                                <option value="-2">冲正</option>
                                <option value="00">成功</option>
                                <option value="2">失败</option>
                                <option value="1">补录</option>
                                <option value="99">未支付</option>
                                <option value="32">交易失败</option>
                            </select>
                        </li>
                        <li>
                            <label>交易类型：</label>
                            <select name="msgtype">
                                <option value="">请选择</option>
                                <option value="H201">支付宝</option>
                                <option value="H202">微信</option>
                                <option value="H302">银联二维码</option>
                            </select>
                        </li>
                        <li>
                            <label style="width: 80px;">结算人姓名：</label>
                            <input type="text" name="screen_name"/>
                        </li>
                        <li>
                            <label style="width: 80px;">服务商编号：</label>
                            <input type="text" name="agent_no"/>
                        </li>

                        <li>
                            <label>终端号：</label>
                            <input type="text" name="posno"/>
                        </li>
                        <li>
                            <label>清算状态：</label>
                            <select name="auState">
                                <option value="">请选择</option>
                                <option value="0">未清</option>
                                <option value="1">已清</option>
                            </select>
                        </li>
                      <!--  <li>
                            <label>卡类型：</label>
                            <select name="cardtype">
                                <option value="">请选择</option>
                                <option value="0">未知</option>
                                <option value="1">借记卡</option>
                                <option value="2">贷记卡</option>
                                <option value="3">预付费卡</option>
                            </select>
                        </li>-->
                        <li>
                            <label>结算类型：</label>
                            <select name="settType">
                                <option value="">请选择</option>
                                <option value="0">D0</option>
                                <option value="1">T1</option>
                            </select>
                        </li>
                        <!--<li>
                            <label style="width: 80px">结算人姓名：</label>
                            <input type="text" name="screen_name"/>
                        </li>-->

                        <li>
                            <label style="width: 80px;">商户类型：</label>
                            <select name="mer_type">
                                <option value="">请选择</option>
                                <option value="0">传统商户</option>
                                <option value="5">电签商户</option>
                            </select>
                        </li>
                        <li class="select-time">
                            <label style="width: 80px;">交易日期：</label>
                            <input type="text" class="time-input" readonly id="startlocaldate" placeholder="开始时间" name="startDate"/>
                            <span>-</span>
                            <input type="text" class="time-input" readonly id="endlocaldate" placeholder="结束时间" name="endDate"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('bankExpenditure:bankExpenditure:edit')}]];
    var removeFlag = [[${@permission.hasPermi('bankExpenditure:bankExpenditure:remove')}]];
    var prefix = ctx + "bankExpenditure/bankExpenditure";

    $(function () {
        var options = {
            url: prefix + "/onLine",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "消费",
            firstLoad:false,
            columns: [{
                radio: true
            },
                {
                    field: 'SERIAL',
                    title: '流水号'
                },
                {
                    field: 'MERNO',
                    title: '商户编号'
                },
                {
                    field: 'MER_NAME',
                    title: '商户名称'
                },
                {
                    field: 'AGENT_NO',
                    title: '服务商编号'
                },
                {
                    field: 'AGENT_NAME',
                    title: '服务商名称'
                },
                {
                    field: 'SCREEN_NAME',
                    title: '结算人'
                },
                {
                    field: 'MSGTYPE',
                    title: '交易类型',
                    formatter: function (value, row, index) {
                        if ("H201" == value) {
                            return '<span style="color:blue;">支付宝</span>';
                        } else if ("H202" == value) {
                            return '<span style="color:red;">微信</span>';
                        } else if ("H302" == value) {
                            return '<span style="color:blue;">银联二维码</span>';
                        } else if ("H304" == value) {
                            return '<span style="color:blue;">码付</span>';
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'TERNO',
                    title: '终端号'
                },
                {
                    field: 'MRCHTM',
                    title: '交易时间'
                },
                {
                    field: 'PAN',
                    title: '交易卡号'
                },
                {
                    field: 'AMOUNT',
                    title: '交易金额',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'STATUS',
                    title: '交易状态',
                    formatter: function (value, row, index) {
                        if("00" == value) {
                            return '<span style="color:green;">成功</span>';
                        }else if ("1" == value) {
                            return '<span style="color:orange;">补录</span>';
                        } else if ("99" == value) {
                            return '<span style="color:gray;">未支付</span>';
                        } else if ("32" == value) {
                            return '<span style="color:red;">交易失败</span>';
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'SETT_TYPE',
                    title: '清算类型',
                    formatter: function (value, row, index) {
                        if ("0" == value) {
                            return '<span style="color:red;">D0</span>';
                        } else if ("1" == value) {
                            return '<span style="color:green;">T1</span>';
                        }
                    }
                },
                {
                    field: 'AU_STATE',
                    title: '清算状态',
                    formatter: function (value, row, index) {
                        if ("0" == value) {
                            return '<span style="color:red;">未清算</span>';
                        } else if ("1" == value) {
                            return '<span style="color:green;">已清算</span>';
                        }else{
                            return '<span style="color:gray;">暂无</span>';
                        }
                    }
                }]
        };
        $.table.init(options);
    });

</script>
</body>
</html>